/**
 * 
 */
package org.gas.barapraja.proc;

import com.logica.smpp.pdu.Request;
import com.logica.smpp.pdu.Response;

/**
 * @author gilang
 *
 */
public abstract class PduProcessor {
	
	protected boolean active=true;
	
	protected String proccessName;
	
	protected GasSmscSession session;
	
	public PduProcessor(){
		
	}

	/**
	 * @return the active
	 */
	public boolean isActive() {
		return active;
	}

	/**
	 * @param active the active to set
	 */
	public void setActive(boolean active) {
		this.active = active;
	}
	
	/**
	 * 
	 */
	public void addToContainer(){
		PduProcessorContainer.getContainerInstance().addProcessor(this);
	}
	
	/**
	 * 
	 */
	public void stop(){
		PduProcessorContainer.getContainerInstance().remove(this);
		active=false;
	}

	/**
	 * @return the proccessName
	 */
	public String getProccessName() {
		return proccessName;
	}

	/**
	 * @param proccessName the proccessName to set
	 */
	public void setProccessName(String proccessName) {
		this.proccessName = proccessName;
	}
	
	/**
	 * 
	 * @param request
	 */
	public abstract void clientRequest(Request request);
	
	/**
	 * 
	 * @param response
	 */
	public abstract void clientResponse(Response response);
	
	/**
	 * 
	 * @param request
	 */
	public abstract void serverRequest(Request request);
	
	/**
	 * 
	 * @param response
	 */
	public abstract void serverResponse(Response response);


	/**
	 * @return the session
	 */
	public GasSmscSession getSession() {
		return session;
	}

	/**
	 * @param session the session to set
	 */
	public void setSession(GasSmscSession session) {
		this.session = session;
	}
	
	

}
